package imwej.android.app;

import imwej.android.chart.fragment.PieFragment;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentTransaction;
import android.widget.FrameLayout;

public class DemoActivity extends FragmentActivity {
	
    private FrameLayout layout_main;

	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        layout_main = (FrameLayout)findViewById(R.id.layout_main);
        
//        gotoPage(0);
    }
	
	private void gotoPage(int page_id) {
		switch(page_id) {
		case 0:
		default:
			switchToFragment();
			break;
		}
	}
	
	private void switchToFragment() {
		FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
		ft.add(R.id.layout_main, new PieFragment(), "pie");
		ft.commit();
	}

	public static class Byref<T> extends Object {
		public T value;
		public Byref(T value) {
			this.value = value;
		}
	}
}